package com.hotel.tv.repositories.emp.query;

import com.autumn.domain.repositories.DefaultEntityRepository;
import com.autumn.mybatis.mapper.annotation.MapperViewSelect;
import com.hotel.tv.constants.FileUploadAttachmentTypeConstant;
import com.hotel.tv.entities.emp.query.EmpInfoQuery;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * </p>
 *
 * @description TODO
 * @author: 老码农
 * @create: 2020-04-08 15:14
 **/
@Repository
@MapperViewSelect("SELECT a.id,a.post_id,a.emp_code,a.role_id,a.emp_name," +
        "b.name as post_name,c.name as role_name,d.url_full_path as head_path" +
        " FROM base_emp AS a inner join common_data_dictionary as b on a.post_id = b.id " +
        " inner join common_data_dictionary as c on a.role_id = c.id " +
        " left join sys_file_attachment_information as d on d.target_id = a.id and d.file_attachment_type = " + FileUploadAttachmentTypeConstant.EMP_INFO)
public interface EmpInfoQueryRepository extends DefaultEntityRepository<EmpInfoQuery> {

}
